#include"raw_distance_checker.h"
#include"../config.h"
#include"../../../log/log_mgr.h"
RawDistanceChecker::RawDistanceChecker(DistCalc *dist_calc)
	:EdgeChecker("RawDistanceChecker")
{
	this->dist_calc = dist_calc;
}

bool RawDistanceChecker::satisfied(QueryNode &n1, QueryNode &n2)
{
	if(n1.name == n2.name)
		return true;
	double score = dist_calc->dist(n1.name, n2.name);
	if(score > atof(Config::get("hard_query_thr").c_str()))
		return false;
	score = score/(n1.name.length());
	if(score > atof(Config::get("prob_query_thr").c_str()))
		return false;
	return true;
}